﻿package java_45;

import java.util.Scanner;

public class Ccode {
		int money;
		Scanner input = new Scanner(System.in);
		public boolean cunQu(){
			for (int i = 0; i < 3; i++) {
				
			System.out.println("1.存款2.取款0.退出");
			System.out.println("请选择你要办理的业务");
			int a=input.nextInt();
			if (a==1) {
				System.out.println("请输入存款金额");
				int money=input.nextInt();
				this.money=this.money+money;
				System.out.println("存款成功\n" + "当前余额为:" + this.money);
			}else
				if (a==2) {
					System.out.println("请输入取款金额");
					int money=input.nextInt();
					this.money=this.money-money;
					System.out.println("取款成功\n" + "当前余额为:" + this.money);
				}else
					if (a==0) {
						System.out.println("谢谢使用");
						
					}else{
						return false;
						break;
					}
			}
			return true;
		}
}
